/**
 * 发票接口
 */

const http = uni.$u.http;

const invoiceApi = {
	
	// 申请开票
	invoiceCreate: data => http.post('/invoice/create', data),
	 
	// 批量开票
	invoiceCreateList: data => http.post('/invoice/create/list', data),
	
	// 开票记录
	invoiceList: data => http.post('/invoice/list', data), 
	
	// 发票订单信息（1已完成（未开票），已开票2）
	invoiceOrderList: data => http.post('/invoice/order/list', data), 
	
	// 获取发票详情
	getInvoiceDetail: params => http.get('/invoice/detail/' + params.id, { params }), 
	
	// 获取发票开具历史记录
	getInvoiceHistoryList: data => http.post('/invoice/list', data),
	
	// 发票抬头列表
	getInvoiceTitleList: params => http.get('/invoice/title/page', { params }), 
	
	// 默认发票抬头
	defaultInvoiceInfo: params => http.get('/invoice/title/get-default', { params }), 
	
	// 获取发票抬头详情
	getInvoiceTitleInfo: params => http.get('/invoice/title/detail/' + params.id, { params }), 
	
	// 新增发票抬头
	addInvoiceTitle: data => http.post('/invoice/title/create', data), 
	
	// 修改发票抬头
	editInvoiceTitle: data => http.put('/invoice/title/update', data), 
	
	// 删除发票抬头
	delInvoiceTitle: data => http.delete('/invoice/title/delete?id=' + data.id, data), 
}

export default invoiceApi